package com.msmall.community.keyword.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.msmall.base.model.BaseObject;
import com.msmall.base.util.Constants;
import com.msmall.community.keyword.util.KeywordUtil;

@Entity
@Table(name="base_keyword")
public class Keyword extends BaseObject{
	
	private static final long serialVersionUID = -7766251049307521369L;

	@Id
	@Column(name="keyword_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long keywordid;
	
	/**
	 * 类型
	 */
	@Column(name="types")
	private Short types;
	
	/**
	 * 版块
	 */
	@Column(name="module")
	private Short module;
	
	/**
	 * 关键字
	 */
	@Column(name="name")
	private String name;

	/**
	 * 样式(只能适合 a)
	 */
	@Column(name="style")
	private String style;
	/**
	 * URL
	 */
	@Column(name="keyword_url")
	private String keywordUrl;
	
	/**
	 * 1为最高序
	 */
	@Column(name="orders")
	private Integer orders;
	
	@Column(name="image_path")
	private String imagePath;
	
	@Column(name="image_name")
	private String imageName;
	
	@Column(name="description")
	private String description;

	@Column(name="enabled")
	private Short enabled;
	
	@Column(name="create_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	
	public Long getKeywordid() {
		return keywordid;
	}

	public void setKeywordid(Long keywordid) {
		this.keywordid = keywordid;
	}

	public Short getTypes() {
		return types;
	}

	public void setTypes(Short types) {
		this.types = types;
	}

	public Short getModule() {
		return module;
	}

	public void setModule(Short module) {
		this.module = module;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public String getKeywordUrl() {
		return keywordUrl;
	}

	public void setKeywordUrl(String keywordUrl) {
		this.keywordUrl = keywordUrl;
	}

	public Integer getOrders() {
		return orders;
	}

	public void setOrders(Integer orders) {
		this.orders = orders;
	}

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	public String getImageName() {
		return imageName;
	}

	public void setImageName(String imageName) {
		this.imageName = imageName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Short getEnabled() {
		return enabled;
	}

	public void setEnabled(Short enabled) {
		this.enabled = enabled;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getHtmlImage(){
		return KeywordUtil.getHomePath(Constants.USER_AGENT_TYPE_HTML) + imageName;
	}
	
	public String getWmlImage(){
		return KeywordUtil.getHomePath(Constants.USER_AGENT_TYPE_WML) + imageName;
	}
	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
}
